// TOWN DIALOGUE SCRIPT
//    Town 123: Inn of Blades

begintalkscript;

variables;

short i,j,k,r1,choice;

begintalknode;
	tag = 1;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "You try to make conversation, but you don't have any luck. Most of the travelers on the dangerous roads of Valorim just want to keep to themselves.";

// Claw Hardblade

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Claw Hardblade";
	text1 = "There is an old man behind the counter, pulling beers. He's doesn't look very strong or agile, but he has several large knives sheathed at his belt. They're clearly meant for more than cooking.";
	text2 = "He nods at you. _Welcome, traveler. Bet you've come a long way. I'm known as Claw Hardblade._";
	text5 = "_What can I get you, adventurer?_ Claw looks slightly embarrassed as he says it.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_What is this place?_";
	text1 = "_I've run this inn here for many years. We have our own special brew of beer, only five coins for a round. We also have one room open, only ten coins for the night._";

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_How long have you run this place?_";
	text1 = "_I started this inn when Krizsan Province was still the border of civilization. Back then, everything was much rougher._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_Where is Krizsan Province relative to everywhere else?_";
	text1 = "_This is the southernmost province in Valorim, and the most recently settled. When people first moved down here, about twenty years ago, it was pretty rough._";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_The border to what?_";
	text1 = "_The border of the settled lands. This was about the only area unsettled by humans in the whole world._";

begintalknode;
	state = 4;
	nextstate = 5;
	question = "_How rough was it?_";
	text1 = "_There were bandits down here, and goblins, and hordes of nephilim too. I provided a safe place for people to stay when moving south. That's when I got my nickname._";

begintalknode;
	state = 5;
	nextstate = -1;
	question = "_Are there any goblins left?_";
	text1 = "He pats the knives at his side. _Most of them are gone, but not all. That's where my nickname came from._";

begintalknode;
	state = 5;
	nextstate = -1;
	question = "_Tell me about your nickname?_";
	text1 = "_I took on the name Claw Hardblade so people knew I meant business. I did my share of killing to back the name up. Now, people won't call me anything else, and it lets people pretend it's still the rough old days._";
	text2 = "_So I'm Claw Hardblade until I retire. There you go._";

begintalknode;
	state = 5;
	nextstate = 6;
	question = "_What happened to all of the nephilim?_";
	text1 = "He seems unwilling to talk about it in the presence of a nephil. _They were all ... they ... it was a terrible injustice. Not all of them were hostile. You know how the Empire was towards non-humans._";
	text3 = "He shakes his head. _Some sent to Avernum. The rest slaughtered. I think it was a shame. Some of them were hostile, but the rest just wanted to live their lives. But the Empire? All non-humans were in for it then._";
	code =
		if (species_in_party(2))
			remove_string(3);
			else remove_string(1);
	break;

begintalknode;
	state = 6;
	nextstate = -1;
	question = "_How is the Empire now?_";
	text1 = "_Much better, if you ask me. Since Empress Prazac came to power, non-humans have actually been tolerated. That's why you can be here without everyone shouting to hang the nephil._";
	text3 = "_Much better, if you ask me. Since Empress Prazac came to power, non-humans have actually been tolerated. A real improvement, if you ask me._";
	code =
		if (species_in_party(2))
			remove_string(3);
			else remove_string(1);
	break;


begintalknode;
	state = 1;
	nextstate = -1;
	condition = coins_amount() >= 10;
	question = "_Can I get a room for the night?_ Pay ten coins.";
	text1 = "Claw leads you to your room and wishes you a restful night's sleep. Despite a few mild bedbug bites, you have an acceptable night.";
	action = END_TALK;	
	code =
		revive_party();
		change_coins(-10);
		relocate_char(get_pc_id(0),27,27,FALSE);
		relocate_char(get_pc_id(1),28,27,FALSE);
		relocate_char(get_pc_id(2),28,28,FALSE);
		relocate_char(get_pc_id(3),27,28,FALSE);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = coins_amount() >= 5;
	question = "_I'd like some liquid refreshment._ Pay five coins.";
	text1 = "You drink the beer. After Avernum's ale, it tastes fantastic to you. The other people in the bar don't look so impressed.";
	code =
		force_char_status(30000,1,20);
		change_coins(-5);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = 1;
	question = "_I don't need anything else._";
	text1 = "_Then come back when you need me. Feel free to rest. Talk. Play cards. Just don't cause any trouble._";
	action = END_TALK;

// Arion

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "Arion";
	text1 = "There is a mage sitting here, deep in his cups. He motions you to sit with him.";
	text2 = "_I'm Arion._ He takes a swig of beer. _How are you?_ He is fuzzy and disconnected.";
	text5 = "Arion takes a swig of beer. He watches you silently, gently swaying from side to side.";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_Where are you traveling to?_";
	text1 = "_Nowhere, yet. I've been stuck here for a while. Minor difficulties._ He shrugs, and drinks more. _I was going south to find a teacher. I just came from the Isle of Bigail._";

begintalknode;
	state = 30;
	nextstate = 31;
	question = "_Why are you stuck?_";
	text1 = "He drinks some beer and seems to approve of the taste. _There are worse places to be stuck, but I would prefer to settle my difficulties and keep moving south._";

begintalknode;
	state = 31;
	nextstate = 33;
	question = "_You didn't really answer my question._";
	text1 = "He looks at you blankly. _That's more than I want to go into. Just a minor disagreement regarding some lumps of metal._";

begintalknode;
	state = 30;
	nextstate = 32;
	question = "_Who is the teacher you are looking for?_";
	text1 = "_He is a wizard. None know his name, but he travels around Krizsan Province, spreading wisdom._";

begintalknode;
	state = 32;
	nextstate = -1;
	question = "_What sort of wisdom?_";
	text1 = "_He has said 'When you find the identity of another, you lose the identity of yourself.' One can ponder his wisdom for many months and not see the true heart of it!_";

begintalknode;
	state = 33;
	nextstate = 35;
	condition = gf(123,9) <= 1;
	question = "_What's so special about some lumps of metal?_";
	text1 = "_I have concealed several pieces of metal nearby. I wish it brought to me. It is not too valuable to most, but has uses for my work._";
	text2 = "_To the north, on the east side of the river, are several spires of stone in a diamond shape. The metal is hidden at the base of a stone spire due north of the center of the diamond. Please bring it to me, and I will reward you._";
	action = SET_SDF 123 9 1;
	code =
		toggle_quest(28,1);
	break;

begintalknode;
	state = 35;
	nextstate = -1;
	question = "_Why don't you get the metal yourself?_";
	text1 = "_I ... I ... It's complicated. I'm scared of the woods. I get lost easily. No more reason than that._ He drinks deep from his ale.";
	
begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(123,9) == 1 && has_spec_item(38) > 0;
	question = "_I've brought those metal lumps you hid._ (Give them to him.)";
	code =
		run_hardcode(124);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(123,9) >= 2;
	question = "_Now that you have your metal, are you leaving?_";
	text1 = "He finishes his drink. _Yes. Yes, I am. Before I go, though, I left something for you. If you need to know the spell I taught you, look in the dresser in the northernmost room of this inn._";
	text2 = "He stands, bows, and leaves.";
	action = END_TALK;
	code =
		sf(123,11,1);
		erase_char(12308);
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(123,9) >= 2;
	question = "_What was that metal?_";
	text1 = "_Magically processed steel and silver alloy. With a great amount of effort and magical skill, it will be worked into a powerful magical charm._";

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(123,9) >= 2;
	question = "_The people who attacked us had red eyes tattooed on their wrists. Why?_";
	text1 = "He looks very uncomfortable. _I have no idea. No idea who they might be. At all._ You are sure that he's lying, but you can't get the truth out of him.";

begintalknode;
	state = 32;
	nextstate = -1;
	question = "_I need a teacher too. Can you teach us anything?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Arion's Spells","Arion is able to teach you a few spells in return for travel expenses. He seems to feel that these rituals are far beneath him, but, fortunately, he will still deign to describe them.",29,4,3);
	break;

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_How could I get to the Isle?_";
	text1 = "_Head north to Farport. You can catch a ferry. Watch out, though. The island is infested with horrible, disease-carrying bugs._";
	text3 = "_Head north to Farport. You can catch a ferry._";
	action = DEP_ON_SDF 307 5 0;

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_Are you feeling all right?_";
	text1 = "_Sure. Nothing a gallon of beer can't help._ He takes another swig.";

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_Goodbye._";
	text1 = "_Goodbyeing to you too. Hic!_";
	action = END_TALK;
	
// Oralse

begintalknode;
	tag = 80;
	state = -1;
	nextstate = 57;
	question = "Oralse";
	text1 = "The man at the bar wears very loose blue robes. He eats a spartan meal of bread and fruit. _Greetings, travelers. You are looking for company to ease your minds during your long journey, yes? I am Oralse._";
	text5 = "Oralse smiles serenely. _You wish my company further, yes?_";
	action = INTRO;

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_Why are you here?_";
	text1 = "_I am a traveler. Until recently, I lived on the Isle of Bigail._ He munches a bit of crust.";

begintalknode;
	state = 58;
	nextstate = 59;
	question = "_Why did you leave the Isle of Bigail?_";
	text1 = "_I learned much there, but the monsters became too threatening, so I decided to leave for a while._";

begintalknode;
	state = 58;
	nextstate = 59;
	question = "_What is the Isle of Bigail like?_";
	text1 = "_A splendid isle, home of the Anama Church. It is a source of great learning. Alas, there is a plague there, and what I learned didn't justify the risk._";

begintalknode;
	state = 59;
	nextstate = -1;
	question = "_What sort of monster plague afflicts Bigail?_";
	text1 = "_The isle has been set upon by hordes of cockroaches. They're huge, and they carry lethal diseases. Not a place that encourages people to stay._";

begintalknode;
	state = 59;
	nextstate = 60;
	question = "_What is the Anama Church?_";
	text1 = "He smiles enigmatically. _What they teach, I am unworthy to interpret to you. You will simply have to visit. The Anama effectively rule over the island. You should have little trouble finding them._";
	text2 = "_You can reach the island by boat._";

begintalknode;
	state = 60;
	nextstate = -1;
	question = "_How do I find a boat heading to Bigail?_";
	text1 = "He takes a sip of water. _Take the road north from here. At the T intersection to the northeast, go to Farport to the west. There, you can take a boat to Bigail. I wish you luck. Now, I have much to ponder. Many apologies._";
	action = END_TALK;

begintalknode;
	state = 59;
	nextstate = -1;
	condition = gf(307,5) >= 1;
	question = "_The roaches are gone. We found their lair and destroyed it._";
	text1 = "_You did?_ He stands. _Then my exile will end. I have missed my home and the home of my faith, and I will no longer delay my return. Thank you for letting me know._ He stands up, pays for his drink, and leaves.";
	action = END_TALK;
	code =
		sf(123,12,1);
		erase_char(12304);
		award_party_xp(100,12);
	break;

